<template>
  <div>
     <!-- 日历组件 -->
    <div class="block">
      <el-date-picker
        v-model="value1"
        type="datetimerange"
        range-separator="至"
        start-placeholder=""
        end-placeholder=""
        @change="surepicker"
      >
      </el-date-picker>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      pickerOptions: {},

      value2: "",
      year: new Date().getFullYear(), // 年
      month: new Date().getMonth() + 1, // 月
      riData: new Date().getDate(), //   日
      value1: [
        new Date(this.year, this.month, this.riData, 10, 10),
        new Date(this.year, this.month, this.riData, 11, 10),
      ],
    };
  },
  mounted() {
    if (this.month < 10) {
      this.month = "0" + this.month;
    } else {
    }
    console.log(this.month);
  },
  methods: {
    surepicker(data) {
      console.log(data);
    },
  },
};
</script>

<style></style>
